package com.jyd.P1.exception;

import com.jyd.P1.enums.ResultEnum;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

/**
 * @author jyd1124
 * @date 2023/7/20 14:11
 */
@AllArgsConstructor
@NoArgsConstructor
public class ResponseException extends RuntimeException {

    private int code;

    private String errMsg;

    public ResponseException(ResultEnum resultEnum, String errMsg) {
        this.code = resultEnum.getCode();
        this.errMsg = errMsg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getErrMsg() {
        return errMsg;
    }

    public void setErrMsg(String errMsg) {
        this.errMsg = errMsg;
    }

}
